﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class GalleryAndroid : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["Id"]))
            {
                DBClass db = new DBClass();
                DataSet dsGallery = db.GetAllGallery(Convert.ToInt32(Request.QueryString["Id"]));
                if (dsGallery != null && dsGallery.Tables.Count > 0 && dsGallery.Tables[0].Rows.Count > 0)
                {
                    lbDescription.Text = dsGallery.Tables[0].Rows[0]["Description"].ToString();
                    lbName.Text = dsGallery.Tables[0].Rows[0]["Name"].ToString();
                }
                DataSet ds = db.GetListGalleryImageByGalleryId(Convert.ToInt32(Request.QueryString["Id"]));
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    rptGallery_Image.DataSource = ds.Tables[0];
                    rptGallery_Image.DataBind();
                }
            }
            else
            {
                Response.Redirect("Gallery.aspx");
            }
        }
    }
}